Optimal. Leaf size=196 \[ -\frac {\tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )}{c \sqrt {b^2-4 a c} \left (a e^2-b d e+c d^2\right )}-\frac {\log \left (a+b x+c x^2\right ) (-a e h+b d h-c d g+c e f)}{2 c \left (a e^2-b d e+c d^2\right )}+\frac {\log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{e \left (a e^2-b d e+c d^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.35, antiderivative size = 196, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1628, 634, 618, 206, 628} \[ -\frac {\tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (-c (2 a d h-2 a e g+b d g+b e f)+b h (b d-a e)+2 c^2 d f\right )}{c \sqrt {b^2-4 a c} \left (a e^2-b d e+c d^2\right )}-\frac {\log \left (a+b x+c x^2\right ) (-a e h+b d h-c d g+c e f)}{2 c \left (a e^2-b d e+c d^2\right )}+\frac {\log (d+e x) \left (d^2 h-d e g+e^2 f\right )}{e \left (a e^2-b d e+c d^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 1628
Rubi steps
\begin {align*} \int \frac {f+g x+h x^2}{(d+e x) \left (a+b x+c x^2\right )} \, dx &=\int \left (\frac {e^2 f-d e g+d^2 h}{\left (c d^2-b d e+a e^2\right ) (d+e x)}+\frac {c d f-b e f+a e g-a d h-(c e f-c d g+b d h-a e h) x}{\left (c d^2-b d e+a e^2\right ) \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac {\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}+\frac {\int \frac {c d f-b e f+a e g-a d h-(c e f-c d g+b d h-a e h) x}{a+b x+c x^2} \, dx}{c d^2-b d e+a e^2}\\ &=\frac {\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}-\frac {(c e f-c d g+b d h-a e h) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c \left (c d^2-b d e+a e^2\right )}+\frac {\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c \left (c d^2-b d e+a e^2\right )}\\ &=\frac {\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}-\frac {(c e f-c d g+b d h-a e h) \log \left (a+b x+c x^2\right )}{2 c \left (c d^2-b d e+a e^2\right )}-\frac {\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c \left (c d^2-b d e+a e^2\right )}\\ &=-\frac {\left (2 c^2 d f+b (b d-a e) h-c (b e f+b d g-2 a e g+2 a d h)\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c \sqrt {b^2-4 a c} \left (c d^2-b d e+a e^2\right )}+\frac {\left (e^2 f-d e g+d^2 h\right ) \log (d+e x)}{e \left (c d^2-b d e+a e^2\right )}-\frac {(c e f-c d g+b d h-a e h) \log \left (a+b x+c x^2\right )}{2 c \left (c d^2-b d e+a e^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.21, size = 193, normalized size = 0.98 \[ \frac {-2 e \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right ) \left (c (2 a d h-2 a e g+b d g+b e f)+b h (a e-b d)-2 c^2 d f\right )+2 c \sqrt {4 a c-b^2} \log (d+e x) \left (d^2 h-d e g+e^2 f\right )-e \sqrt {4 a c-b^2} \log (a+x (b+c x)) (-a e h+b d h-c d g+c e f)}{2 c e \sqrt {4 a c-b^2} \left (e (a e-b d)+c d^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 83.61, size = 625, normalized size = 3.19 \[ \left [-\frac {\sqrt {b^{2} - 4 \, a c} {\left ({\left (2 \, c^{2} d e - b c e^{2}\right )} f - {\left (b c d e - 2 \, a c e^{2}\right )} g - {\left (a b e^{2} - {\left (b^{2} - 2 \, a c\right )} d e\right )} h\right )} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e^{2} f - {\left (b^{2} c - 4 \, a c^{2}\right )} d e g + {\left ({\left (b^{3} - 4 \, a b c\right )} d e - {\left (a b^{2} - 4 \, a^{2} c\right )} e^{2}\right )} h\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e^{2} f - {\left (b^{2} c - 4 \, a c^{2}\right )} d e g + {\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} h\right )} \log \left (e x + d\right )}{2 \, {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d^{2} e - {\left (b^{3} c - 4 \, a b c^{2}\right )} d e^{2} + {\left (a b^{2} c - 4 \, a^{2} c^{2}\right )} e^{3}\right )}}, -\frac {2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (2 \, c^{2} d e - b c e^{2}\right )} f - {\left (b c d e - 2 \, a c e^{2}\right )} g - {\left (a b e^{2} - {\left (b^{2} - 2 \, a c\right )} d e\right )} h\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e^{2} f - {\left (b^{2} c - 4 \, a c^{2}\right )} d e g + {\left ({\left (b^{3} - 4 \, a b c\right )} d e - {\left (a b^{2} - 4 \, a^{2} c\right )} e^{2}\right )} h\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, {\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e^{2} f - {\left (b^{2} c - 4 \, a c^{2}\right )} d e g + {\left (b^{2} c - 4 \, a c^{2}\right )} d^{2} h\right )} \log \left (e x + d\right )}{2 \, {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d^{2} e - {\left (b^{3} c - 4 \, a b c^{2}\right )} d e^{2} + {\left (a b^{2} c - 4 \, a^{2} c^{2}\right )} e^{3}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 204, normalized size = 1.04 \[ \frac {{\left (c d g - b d h - c f e + a h e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (c^{2} d^{2} - b c d e + a c e^{2}\right )}} + \frac {{\left (d^{2} h - d g e + f e^{2}\right )} \log \left ({\left | x e + d \right |}\right )}{c d^{2} e - b d e^{2} + a e^{3}} + \frac {{\left (2 \, c^{2} d f - b c d g + b^{2} d h - 2 \, a c d h - b c f e + 2 \, a c g e - a b h e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{{\left (c^{2} d^{2} - b c d e + a c e^{2}\right )} \sqrt {-b^{2} + 4 \, a c}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.01, size = 622, normalized size = 3.17 \[ -\frac {a b e h \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}\, c}-\frac {2 a d h \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}}+\frac {2 a e g \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}}+\frac {b^{2} d h \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}\, c}-\frac {b d g \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}}-\frac {b e f \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}}+\frac {2 c d f \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) \sqrt {4 a c -b^{2}}}+\frac {a e h \ln \left (c \,x^{2}+b x +a \right )}{2 \left (a \,e^{2}-b d e +c \,d^{2}\right ) c}-\frac {b d h \ln \left (c \,x^{2}+b x +a \right )}{2 \left (a \,e^{2}-b d e +c \,d^{2}\right ) c}+\frac {d^{2} h \ln \left (e x +d \right )}{\left (a \,e^{2}-b d e +c \,d^{2}\right ) e}-\frac {d g \ln \left (e x +d \right )}{a \,e^{2}-b d e +c \,d^{2}}+\frac {d g \ln \left (c \,x^{2}+b x +a \right )}{2 a \,e^{2}-2 b d e +2 c \,d^{2}}+\frac {e f \ln \left (e x +d \right )}{a \,e^{2}-b d e +c \,d^{2}}-\frac {e f \ln \left (c \,x^{2}+b x +a \right )}{2 \left (a \,e^{2}-b d e +c \,d^{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.45, size = 2467, normalized size = 12.59 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________